package thread.test04.demo02;

/**
 * ClassName: MyThread
 * Description:
 *
 * @Author zjl
 * @Create 2025/03/11 19:05
 * @Version 1.0
 */
public class MyThread extends Thread{
    private int tickets = 50;

    public MyThread() {

    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        if (tickets > 0) {
            System.out.println(Thread.currentThread().getName() + "正在出售第" + (tickets--) + "张票");
        }
    }
}
